﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using BHG.System;

namespace GameStateManagement
{
    class LevelChoiceScreen : MenuScreen 
    {

        public LevelChoiceScreen()
            : base("Choose level")
        {
            //TODO level unlocking
            MenuEntry level01 = new MenuEntry("Level 01");
            level01.Selected += OnLevel01Select;
            MenuEntries.Add(level01);

            MenuEntry level02 = new MenuEntry("Level 02");
            level02.Selected += OnLevel02Select;
            MenuEntries.Add(level02);

            MenuEntry level03 = new MenuEntry("Level 03");
            level03.Selected += OnLevel03Select;
            MenuEntries.Add(level03);

            MenuEntry level04 = new MenuEntry("Level 04");
            level04.Selected += OnLevel04Select;
            MenuEntries.Add(level04);

            MenuEntry level05 = new MenuEntry("Credits");
            level05.Selected += OnLevel05Select;
            MenuEntries.Add(level05);
        }

        void OnLevel01Select(object sender, PlayerIndexEventArgs e)
        {
            LoadingScreen.Load(ScreenManager, true, e.PlayerIndex,CurrentGame.createNewLevel(1));
        }

        void OnLevel02Select(object sender, PlayerIndexEventArgs e)
        {
            LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, CurrentGame.createNewLevel(2));
        }

        void OnLevel03Select(object sender, PlayerIndexEventArgs e)
        {
            LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, CurrentGame.createNewLevel(3));
        }

        void OnLevel04Select(object sender, PlayerIndexEventArgs e)
        {
            LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, CurrentGame.createNewLevel(4));
        }

        void OnLevel05Select(object sender, PlayerIndexEventArgs e)
        {
            LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, CurrentGame.createNewLevel(5));
        }
    }
}
